
###
 # @Author: Clark
 # @Email: haixuanwoTxh@gmail.com
 # @Date: 2022-12-27 10:43:10
 # @LastEditors: Clark
 # @LastEditTime: 2022-12-27 10:42:26
 # @Description: file content
###

MEDIA_PATH="/media/${USER}"
BCTC_FILE="~/.ssh"
COPY_FLAG=0

while [ true ]
do
    SD_PATH=`mount | grep ${MEDIA_PATH} | awk -F ' ' '{print $3}'`
    if [ -z "${SD_PATH}" ]
    then
        echo "The USB Flash have not inserted";
        COPY_FLAG=0
    else
        if [ 0 -eq ${COPY_FLAG} ]
        then
            echo "Insert USB flash, Do what you want to do!!!"
        fi

        COPY_FLAG=1
        echo "The USB Flash have inserted";
    fi

    sleep 1
done
